﻿using System.Collections.Generic;
using System.ServiceModel;

namespace Metro.Kashikoi.ServiceContract.Item
{
    /// <summary>
    /// WCF client of the <c>ICategoryService</c>.
    /// </summary>
    public class CategoryServiceClient : ClientBase<ICategoryService>, ICategoryService
    {
        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="LocationServiceClient"/> class.
        /// </summary>
        public CategoryServiceClient() :
            base("category")
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="LocationServiceClient"/> class.
        /// </summary>
        /// <param name="remoteAddress">The remote address.</param>
        public CategoryServiceClient(string remoteAddress) :
            base("category", remoteAddress)
        {
        }

        #endregion


        /// <summary>
        /// Creates the category.
        /// </summary>
        /// <param name="category">The category to be created.</param>
        /// <returns>
        /// The newly created category.
        /// </returns>
        public ColorCategory CreateCategory(ColorCategory category)
        {
            return base.Channel.CreateCategory(category);
        }

        /// <summary>
        /// Updates the category.
        /// </summary>
        /// <param name="category">The category to be updated.</param>
        public void UpdateCategory(ColorCategory category)
        {
            base.Channel.UpdateCategory(category);
        }

        /// <summary>
        /// Deletes the category.
        /// </summary>
        /// <param name="categoryId">The category id.</param>
        public void DeleteCategory(int categoryId)
        {
            base.Channel.DeleteCategory(categoryId);
        }

        /// <summary>
        /// Gets the category by id.
        /// </summary>
        /// <param name="id">The category id.</param>
        /// <returns>
        /// The category with specific id.
        /// </returns>
        public ColorCategory GetCategory(int id)
        {
            return base.Channel.GetCategory(id);
        }

        /// <summary>
        /// Gets all the categories.
        /// </summary>
        /// <returns>
        /// A list of the category.
        /// </returns>
        public IList<ColorCategory> GetAllCategories()
        {
            return base.Channel.GetAllCategories();
        }
    }
}
